﻿@model Model.AppUserList
@{
    ViewBag.Title = "LocationInventory";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}
@using Model

@section JQscriptSection{
    <script type="text/javascript">
        $(document).ready(function () {
            InitGrid();

        });

        HandleDom.ClassTriggerClick("icon-exporter", function () {
            var form = $('#query');
            var rows = $(".pagination-page-list option:selected").text();
            var page = $("input[size='2']").val();
            form.form('submit', {
                url: '@Url.Content("~/LocationInventory/ExportExcel")' + '?page=' + page + '&rows=' + rows,
                success: function (data) {
                    eval('data=' + data);
                    if (data.success) {
                        layer.alert('执行成功!', 9);
                    } else {
                        layer.msg(data.msg, 1);
                    }
                }
            });

        });
        function InitGrid() {
            var txtGOODSBATCHCODE = $('#txtGOODSBATCHCODE').val();
            var txtLOCATIONCODE = $('#txtLOCATIONCODE').val();
            var txtGOODSCODE = $('#txtGOODSCODE').val();
            var txtGOODSNAME = $('#txtGOODSNAME').val();
            ;

            queryParams = {
                goodsBatchCode: txtGOODSBATCHCODE,
                locationCode: txtLOCATIONCODE,
                goodsCode: txtGOODSCODE,
                goodsName: txtGOODSNAME
            }
            HandleData.InitDataGrid('dg', '/LocationInventory/InitJsonResult', 'toolbar', queryParams, 'LOCATIONINVENTORYID', true, function (data) { },
                function (rowIndex, rowData) {//双击
                    edit(rowData);
                });
        }
    </script>
}

<body style="background-color: ButtonFace; font-size: 17px">
    <div class="easyui-panel" title="查询条件" style="height: 130px; padding: 5px; background: #fafafa; width: 1700px;">
        <form id="query" method="post">
            <table>
                <tr>
                    <td>商品批次号:
                    </td>
                    <td>
                        <input id="txtGOODSBATCHCODE" name="txtGOODSBATCHCODE" style="width: 154px" />
                    </td>
                    <td>货位编码:
                    </td>
                    <td>
                        <input id="txtLOCATIONCODE" name="txtLOCATIONCODE" style="width: 154px" />
                    </td>
                    <td>商品编码:
                    </td>
                    <td>
                        <input id="txtGOODSCODE" name="txtGOODSCODE" style="width: 154px" />
                    </td>
                    <td>商品名称:
                    </td>
                    <td>
                        <input id="txtGOODSNAME" name="txtGOODSNAME" style="width: 154px" />
                    </td>
                    <td>
                        <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="InitGrid()">查询</a>
                    </td>
                </tr>
            </table>
        </form>

    </div>
    <div style="min-height: 720px; width: 1700px;">
        <table id="dg" title="货位信息" style="min-height: 600px;">
            <thead>
                <tr>
                    <th data-options="field:'LOCATIONINVENTORYID',width:30">货位库存ID</th>
                    <th data-options="field:'GOODSBATCHCODE',width:50">商品批次号</th>
                    <th data-options="field:'LOCATIONCODE',width:50">货位编码</th>
                    <th data-options="field:'GOODSCODE',width:50">商品编码</th>
                    <th data-options="field:'GOODSNAME',width:50">商品名称</th>
                    <th data-options="field:'WAREHOUSENAME',width:50">仓库</th>
                    <th data-options="field:'CELLNO',width:30">库位</th>
                    <th data-options="field:'PRODUCTIONDATE',width:30">生产日期</th>
                    <th data-options="field:'EXPIRYDAYS',width:30">保质天数</th>
                    <th data-options="field:'QTY',width:30">库存数</th>
                    <th data-options="field:'UNITNAME',width:30">单位</th>
                    <th data-options="field:'PURQTY',width:50, align: 'center', sortable: true, formatter:function(value, rowData, rowIndex){ return FormatData.formatvalidSumQty(rowData);}">采购单位库存</th>
                    <th data-options="field:'STORAGEDATE',width:100, align: 'center', sortable: true, formatter:function(value, rowData, rowIndex){ return FormatData.formatvalidDay(rowData);}">有效天数</th>
                    <th data-options="field:'PURUNITQTY',width:100">换算系数</th>
                </tr>
            </thead>
        </table>
    </div>
    @Html.Partial("~/Views/Shared/_PartialToolbar.cshtml", new Toolbar
{
    GridName = "dg",
    GridType = "datagrid",
    ToolbarName = "toolbar",
    FunctionModule = new Dictionary<string, List<FunctionModule>>()
    {
        {"Function",new List<FunctionModule>()
            {
              new FunctionModule(){Name = "Add",IsEnable =false },
              new FunctionModule(){Name = "Edit",IsEnable =false },
              new FunctionModule(){Name = "Remove",IsEnable =false },
              new FunctionModule(){Name = "Reload",IsEnable =false },
              new FunctionModule(){Name = "Collapse",IsEnable =false },
              new FunctionModule(){Name = "Exporter",IsEnable =true },
              
            }
        }
    }
})

</body>

